package cn.tedu.vrd07.controller;

import cn.tedu.vrd07.entity.Category;
import cn.tedu.vrd07.mapper.CategoryMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/category/")
public class CategoryController {

@Autowired(required = false)
    CategoryMapper mapper;

@RequestMapping("select")
    public List<Category>select(){
    return mapper.select();
}

@RequestMapping("delete")
    public void delete(int id){
    mapper.delete(id);}

@RequestMapping("insert")
    public void insert(Category category){
    mapper.insert(category);}
}